<?php

namespace app\admin\validate;

use think\Validate;

class Specs extends Validate
{
    protected $rule = [
        "id" => "require",
        "specs_id" => "require",
        "name" => "require",
        'status' => ["require", "in"=>"0,1,99"]
    ];

    protected $message = [
        'id' => 'id必须',
        'specs_id' => '规格ID必须',
        'name' => '规格名称必须',
        'status.require' => '状态必须',
        'status.in' => '状态数值错误',
    ];

    protected $scene = [
        'normal' => ['specs_id'],
        'save' => ['specs_id','name'],
        'status' => ['id', 'status']
    ];

}